import {
  getLogin
} from '../commons/index'
Component({
  data: {
    selected: 0,
    color: "#999",
    selectedColor: "#000",
    list: [{
        pagePath: "/pages/index/index",
        iconPath: "/static/image/tabbar_kj.png",
        selectedIconPath: "/static/image/tabars_kj.png",
        text: "空间"
      },
      {
        pagePath: "/pages/my/my",
        iconPath: "/static/image/tabbar_my.png",
        selectedIconPath: "/static/image/tabbars_my.png",
        text: "我的"
      }
    ],
    isShow: true
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({
        url
      })
      this.setData({
        selected: data.index
      })
    },
    headleNavLaunch() {
      if (wx.getStorageSync('userInfo')) {
        wx.navigateTo({
          url: '/pages/launch/launch',
        })
      } else {
        getLogin()
      }

    }
  }
})